package com.faxsun.web.security.authentication;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class ThirdPartyLoginServer {


	@Autowired
	ThirdPartyContext context3rd;
	
	public String handle(HttpServletRequest request,
			HttpServletResponse response, String path, String channelId) {
		if (channelId == null || channelId.isEmpty())
			channelId = request.getParameter("channelId");
		return context3rd.loginContext(channelId, path, request, response);
	}

	public void requestURL(HttpServletRequest request,
			HttpServletResponse response) {
		String channel = request.getParameter("channelId");
		context3rd.responseContext(channel, request, response);
	}

}
